package com.itheima.test03;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.core.annotation.Order;

import java.util.List;

@Configuration  // 相当xml配置
@ComponentScan("com.itheima.test03")  // <context:component-scan
public class SpringConfig {
    @Autowired
    private List<I> i;

    @Bean
    @Order(1)
    public A a() {
        return new A();
    }

    @Bean
    @Order(0)
    public B b() {
        return new B();
    }

    @Bean List<I> c(){
        return i;
    }
}
